<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>

<script type="text/javascript">

$(function(){
	if('${photoPageModel.totalPage}' > 0){
		$("#pager").pager({ pagenumber: ${photoPageModel.currentPage}, 
			pagecount: ${photoPageModel.totalPage},
			buttonClickCallback: function(page){
				$("#content_detail").load("photoPage.htm?album=${album.identifier}&page="+page);
			} 
		});
	}
	
});

function photoPageView(album,picId,friendPhoto){
	$("#photoBox").load("photoView.htm",{"album":album,"picId":picId,"friendPhoto":friendPhoto});
}
</script>

<!--内容快-->
<div class="h_main2">
	<div class="h_data">
		<h2>
			<img src="images/home_images/ico28.png" alt="相册" />
			相册
		</h2>
		<div class="h_newNews">
			<ul>
				<li id="newNews1" onclick="albumInfo();" class="h_newNewsHover">
					<a>家的照片</a>
				</li>
				<!-- 
						<li id="newNews2" onclick="friendAlbum();">
							<a>邻居的照片</a>
						</li>
						 -->
				<span><a href="javascript:void(0);" id="uploadPhoto"
					onclick="albumInfoUploadPhoto();">上传照片</a> </span>
			</ul>
			<div class="clear"></div>
		</div>
		<div id="photoContent">
			<div class="h_newNews_box">
				<div class="h_newNews_text" id="con_newNews_1"
					style="display: block;">
					<div class="data_h_newNews_nav" id="my_photo_top">
						<a href="javascript:void(0);"
							<c:choose>
										<c:when test="${photoModel=='all'}">
											class=""
										</c:when>
										<c:otherwise>
											class="current"
										</c:otherwise>
								</c:choose>
							onclick="albumInfo();">返回家的专辑</a>|
						<a href="javascript:void(0);"
							<c:if test="${photoModel=='all'}">
										class="current"
									</c:if>
							onclick="myPhotoAll();">家的全部照片</a>
					</div>
					<div class="success" id="album_info_tip_success"
						style="display: none;">
						<img alt="保存成功" src="images/home_images/ico29.png" />
						相册保存成功
					</div>
					<div class="success" id="photo_upload_tip_success"
						style="display: none;">
						<img alt="保存成功" src="images/home_images/ico29.png" />
						照片上传成功
					</div>
					<div class="clear"></div>
					<div id="photoBox">
						<div class="photosList_box">
							<c:choose>
								<c:when
									test="${photoPageModel.list == null || fn:length(photoPageModel.list) < 1}">
									<div style="margin-top: 20px; margin-left: 20px;">
										<c:choose>
											<c:when
												test="${album.identifier=='' || album.identifier==null}">
														您目前还没有上传照片，请点击‘<a href="javascript:void(0);"
													onclick="albumInfoUploadPhoto('${album.identifier}');">上传照片</a>’创建您的专辑，上传照片
													</c:when>
											<c:otherwise>
															该专辑下没有照片。<a href="javascript:void(0);"
													onclick="albumInfoUploadPhoto('${album.identifier}');">添加新照片</a>
											</c:otherwise>
										</c:choose>
									</div>


								</c:when>
								<c:otherwise>
									<ul>
										<c:forEach items="${photoPageModel.list}" var="pic">
											<li>
												<span style="overflow: hidden;"><a
													href="javascript:void(0)"
													onclick="photoPageView('${album.identifier}','${pic.identifier}','${friendPhoto}')"><img
															src="${pic.imageServer}${pic.thumbnail}" /> </a> </span>
												<c:out value="${pic.title}"></c:out>
											</li>
										</c:forEach>
										<div class="clear"></div>
									</ul>
								</c:otherwise>
							</c:choose>
							<div class="clear"></div>

						</div>
						<c:if test="${album!=null}">
							<div class="photosShow_text">
								<p>
									专辑：
									<c:out value="${album.name}" />
								</p>
								<p>
									地点：
									<c:out value="${album.place}" />
								</p>
								<p>
									描述：
									<c:out value="${album.description}" />
								</p>
								<p>
									创建时间：
									<fmt:formatDate value="${album.gmtCreated}"
										pattern="yyyy-MM-dd HH:mm:ss" />
								</p>
							</div>
						</c:if>

						<div class="h_page" id="pager"></div>
					</div>
				</div>

			</div>
		</div>
	</div>
</div>
<div class="clear"></div>


